]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
windowManager: refactor WorkspaceSwitchAction callback into separate function
authorCarlos Garnacho <carlosg@gnome.org>
Wed, 1 Jul 2015 13:51:15 +0000 (15:51 +0200)
committerCarlos Garnacho <carlosg@gnome.org>
Wed, 22 Jul 2015 19:19:33 +0000 (21:19 +0200)
This will be used by the touchpad-specific "action" too, so put it in a
shared place.

https://bugzilla.gnome.org/show_bug.cgi?id=752250

js/ui/windowManager.js

index 5c66190f8ec8a34c2b2f1102161aa154dc2bd634..e28ed2d9be9f4f2a61ba0dd0916e9c03e46add3b 100644 (file)
@@ -866,15 +866,18 @@ const WindowManager = new Lang.Class({
                                                 false, -1, 1);
 
         let gesture = new WorkspaceSwitchAction();
-        gesture.connect('activated', Lang.bind(this, function(action, direction) {
-            let newWs = global.screen.get_active_workspace().get_neighbor(direction);
-            this.actionMoveWorkspace(newWs);
-        }));
+        gesture.connect('activated', Lang.bind(this, this._actionSwitchWorkspace));
         global.stage.add_action(gesture);
 
         gesture = new AppSwitchAction();
         gesture.connect('activated', Lang.bind(this, this._switchApp));
         global.stage.add_action(gesture);
+
+    },
+
+    _actionSwitchWorkspace: function(action, direction) {
+            let newWs = global.screen.get_active_workspace().get_neighbor(direction);
+            this.actionMoveWorkspace(newWs);
     },
 
     _lookupIndex: function (windows, metaWindow) {